#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ABS(x) ((x)>0?(x):-(x))
int gcd(int a, int b) {
	return b ? gcd(b, a % b) : a;
}
int main(void) {
	char s[10];
	int a, b, c, d, e, f, g;
	while (gets(s)) {
		a = s[0] - '0', b = s[2] - '0', c = s[4] - '0', d = s[6] - '0';
		if (s[3] == '+') {
			f = b * d;
			e = a * d + b * c;
			g = ABS(gcd(f, e));
			f /= g;
			e /= g;
		} else if (s[3] == '-') {
			f = b * d;
			e = a * d - b * c;
			g = ABS(gcd(f, e));
			f /= g;
			e /= g;
		}
		//printf("%d %d %d %d %d %d %d\n",a,b,c,d,e,f,g);
		if (e == 0)
			printf("0\n");
		else if (f == 1)
			printf("%d\n", e);
		else
			printf("%d/%d\n", e, f);

	}
	return EXIT_SUCCESS;
}
